Xbasic

OBJECT.SEND Function

Syntax

Output_Filename as C = : Object_Type.Send(c layoutname [,c format [,c filter [,c order [,c email_client [,c _to [,c subject [,c message [,c cc [,c bcc [,* printoptions[,arguments as SQL::Arguments]]]]]]]]]]])

Arguments

Object_Type

This word can be any of the following:

"Browse"
"Form"
"Label"
"Letter"
"Report"
layoutname

The name of a form, browse, label, letter, or report layout.

format

Optional. Default = native format. The options for Format are:

Format

File Type

"PDF"

Adobe Acrobat PDF Format

"HTML"

Dynamic HTML

"RTF"

Rich Text Format

"TXT"

Plain Text Format

filter

Optional. Default = all records. An expression that selects records.

order

Optional. Default = record number order. An expression that orders selected records.

email_client

Optional. Default = your default email client. Available options:

"Default"

Your default email client.

"A5"

Internal email client.

_to

Optional. Comma delimited list of addresses.

subject

Optional. Default = "See report: Layout_Name ". The subject of the message. If you want to completely suppress the subject, specify the subject as: " "

message

Optional. Default = "".

cc

Optional. Default = "". Comma delimited list of addresses.

bcc

Optional. Default = "". Comma delimited list of addresses.

printoptions

Optional. Default = NULL. You can override the default system settings on a permanent basis. When you override the system defaults, you settings are stored in a text file in the Alpha Anywhere program folder. These files are named:

AlphaFivePrinterDriver_htm.PrintOptions
AlphaFivePrinterDriver_pdf.PrintOptions
AlphaFivePrinterDriver_rtf.PrintOptions
For more information see print options and LAYOUT.SAVEAS().
arguments

Optional. Default = NULL. Arguments that retrieve value(s) from variable(s) or prompts for value(s) at runtime. Only applicable to SQL Reports. Refer to SQL::Arguments Object.

options

Optional. Default = NULL_VALUE(). Sets filter (WHERE) and order (ORDER BY) expressions for a query against a passive-linked table. A pointer dot variable with 2 elements. Refer to Using the Options Argument.

.filter

Adds to the WHERE clause in the underlying SQL expression.

.order

Replaces the ORDER BY clause in the underlying SQL expression.

Description

Emails a layout as an attached file.

The <OBJECT>.SEND() method emails a layout as an attached file of type Format.

Email is sent using your default email client if Email_Client is blank. You can explicitly set the email client to "Default" or "A5" by setting Email_Client to "Default" or "A5".

This method requires that the user press the Send key to complete the transmission. As a result, <OBJECT>.SEND() is inappropriate for use in web applications. To send a report as an attachment without user interaction, create the attachment using REPORT.SAVEAS() and send it with EMAIL_SEND() or EMAIL_SEND2().

Example

Email a report in PDF format.

:report.Send("Invoice", "PDF")

This script sends a copy of the Invoice report with an argument. You can add as many arguments to the arguments collection as you want.

DIM myargs as SQL::arguments 
 myargs.add("whatcity", "London") 
 report.send("Invoice", "PDF", "", "", "", "", "", "", "", "", NULL_VALUE(), myargs)

Limitations

Desktop applications only.

See Also